package com.Service.Impl;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.Dao.BaseDaoI;
import com.Entity.InterestInfo;
import com.Service.InterestInfoService;

@Service("interestService")
public class InterestInfoServiceImpl extends BaseServiceImpl<InterestInfo>
		implements InterestInfoService {

	@Autowired
	private BaseDaoI<InterestInfo> interestdao;
	private List<InterestInfo> interestlist = new ArrayList<InterestInfo>();

	@Override
	public List<InterestInfo> findByUserId(Integer userid) {
		// TODO Auto-generated method stub
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("userId", userid);
		String hql = "from InterestInfo t where t.userId = :userId and t.isChannel=1";
		interestlist = this.interestdao.find(hql, params);
		return interestlist;
	}

}
